package com.lyfam.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import com.lyfam.annotation.container.ContainerDataSource;
import com.lyfam.annotation.listener.Listener;
import com.vaadin.data.Validator;

@Retention(RetentionPolicy.SOURCE)
@Target(ElementType.FIELD)
public @interface UIField
{
    String label();
    boolean refreshImmediate() default false;
    UIType type() default UIType.TEXTBOX;
    boolean require() default false;
    boolean hidden() default false;
    
    String customFieldFormFactoryClassname() default "";
    
    Class<? extends Validator> validator() default Validator.class;
    Class<? extends Listener> valueChangedListener() default Listener.class;
    Class<? extends ContainerDataSource> dataProvider() default ContainerDataSource.class;
    
    public enum UIType
    {
        TEXTBOX,
        SELECT,
        CUSTOM_FIELD
    }
}
